package flowshop.Solution;

import java.util.Arrays;

public class Solution{

	private int eval_;
	
	private int[] solution_;
	
	private Solution(){
		eval_ = 0;
		solution_ = null;
	}
	
	public Solution(InputData data, int[] solution){
		solution_ = solution.clone();
		eval_ = SolutionEvaluator.getEval(data, solution);
	}
	
	public Solution(InputData data, int[] solution, int i){
		solution_ = solution;
		eval_ = SolutionEvaluator.getEval(data, solution);
	}
	
	public int getEval(){
		return eval_;
	}
	
	public int[] getSolution(){
		return solution_;
	}
	
	public Solution getSolutionCopy(){
		Solution tmpSolution = new Solution();
		tmpSolution.solution_ = new int[this.solution_.length];
		tmpSolution.eval_ = this.eval_;
		for(int i=0; i<this.solution_.length; i++){
			tmpSolution.solution_[i] = this.solution_[i];
		}
		return tmpSolution;
	}
	
	public String toString(){
		return this.getClass()+"("+eval_+", "+Arrays.toString(solution_)+")";
	}
}